'use strict';

const fs = require('fs');
const path = require('path');

let models = {};
let modelFileList = fs.readdirSync(__dirname)
    .filter(item => item != 'index.js')
    .map(item => path.join(__dirname, item));

for (const modelFile of modelFileList) {
    const tableName = path.basename(modelFile,'.js');
    const model = require(modelFile);
    models[tableName] = model;
}

module.exports = models;